package com.atan.xiaohongshu.auth.controller.user;


import com.atan.framework.biz.operationlog.aspect.ApiOperationLog;
import com.atan.framework.common.response.Response;
import com.atan.xiaohongshu.auth.model.vo.user.UserLoginReqVO;
import com.atan.xiaohongshu.auth.service.UserService;
import jakarta.annotation.Resource;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {


    @Autowired
    private UserService userService;
    /**
     * 登录
     */
    @PostMapping("/login")
    @ApiOperationLog(description = "用户登录")
    public Response<String> loginAndRegister(@RequestBody @Validated UserLoginReqVO userLoginReqVO)  {
        return Response.success(userService.loginAndRegister(userLoginReqVO));
    }

    @PostMapping("/logout")
    @ApiOperationLog(description = "账号登出")
    public Response<?> logout() {

        // todo 账号退出登录逻辑待实现

        return Response.success();
    }

}
